var Customer = new Class({
	data:false,
	id:false,
	initialize:function(id) {
		
		customerlist.list.each(function(e,i) { if(e.customer_id == id) { this.data = e; }},this);
		this.id = this.data.customer_id;
	},
	
	update:function(obj) {
		obj.customer_id = this.id;
		j.request('customer_update',obj,function(res){
			if(!res) {
				
			}
		});
		
		// update customerlist
	},
	
	create:function() {
		var m = new Modal({
			windowtitle:'Create New Customer',
			content:templates.new_collection
		});
		$('newcustomer_submit').addEvent('click',function(e){
			if($('new_c_name').value !== '') {
				summary.listProjects();
				
				$('summary').getElements('.content>div').each(function(e) { e.style.display='none'; });
				$('summary').getElement('.content .details').style.display='block';
				/*
				j.request('customer_create',{name:name},function(res) {
					var result = JSON.decode(res);
					
					if(result.result == 'failure') {
						$('response').innerHTML = result.reason;
					} else {
						this.data = result.data;
						this.id = this.data.customer_id;
					}
				});
				*/
			} else {
				$('response').innerHTML = 'Please enter a Name';
			}
		});
	}
});
